<script>
import School from './components/School.vue'

export default {
  name: "App",
  components: {
    School,
  },
  methods: {
    showDOM() {
      //如果是html标签，ref获取到的是dom元素
      //如果是组件，ref获取到的是组件的实例
      console.log(this.$refs.img)
      console.log(this.$refs.school)
    }
  },
}
</script>

<template>
  <div>
    <img src="./assets/logo.png" ref="img">
    <School ref="school"></School>
  <button @click="showDOM">点击</button>
  </div>
</template>

<style scoped>

</style>